public class TreeNode {
     int val;
      TreeNode left;
      TreeNode right;
      TreeNode() {}
      TreeNode(int val) { this.val = val; }
      TreeNode(int val, TreeNode left, TreeNode right) {
          this.val = val;
          this.left = left;
          this.right = right;
      }
}
class Solution {
    public String tree2str(TreeNode root) {

        StringBuilder stringBuilder=new StringBuilder();

        return stringBuilder.toString();

    }
    public void tree2strChild(TreeNode root,StringBuilder stringBuilder){
        if(root==null){
            return;
        }
        stringBuilder.append(root);
        if(root.left!=null){
            stringBuilder.append("(");
            tree2strChild(root.left,stringBuilder);
            stringBuilder.append(")");
        }else{
            if(root.left==null){
                return;
            }else{
                stringBuilder.append("()");
                stringBuilder.append("(");
                tree2strChild(root.right,stringBuilder);
                stringBuilder.append(")");

            }

        }
    }
}